package com.example.seed.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.babyfish.jimmer.sql.ManyToOne;
import org.babyfish.jimmer.sql.MappedSuperclass;
import org.jetbrains.annotations.Nullable;

import java.time.LocalDateTime;

@MappedSuperclass
public interface BaseEntity {


    /**
     * 创建时间
     *
     * @return {@link LocalDateTime}
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime createdAt();

    /**
     * 更新人
     *
     * @return {@link SysUser}
     */
    @ManyToOne
    @Nullable
    SysUser updater();


    /**
     * 更新时间
     *
     * @return {@link LocalDateTime}
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Nullable
    LocalDateTime updatedAt();

}